define(function(require, exports, module) {

	seajs.use(["browser", "menu", "cookieSetting"], function(browser, menu, cookieSetting) {
		browser.init();
		menu.init();
		cookieSetting.init();
	});
	//require('layer');
	var cookieSetting = require("cookieSetting");

	var defaults = {

	};

	var init = function() {
		$("input[name='ckbSetting']").click(function() {
			selectCbk($(this));
		});
	}

	// var settingDialog;
	var alertSetting = function() {
		/*seajs.use('layer', function(layer) {
			$.layer({
				type: 1,
				shade: [0],
				offset : [500, 100],
    			area: ['200px', ($(window).height() - 50) +'px'],
    			title: false,
    			border: [0],
    			page : {dom: '#settingDialog'}
			});
		});*/
	}

	//选中checkbox
	var selectCbk = function(obj) {
		if ($(obj).prop("checked")) {
			if ($(obj).val() === "3") {
				$("input[name='ckbSetting'][value='1'],input[name='ckbSetting'][value='2']").prop("checked", true);
			} else if ($(obj).val() === "2") {
				$("input[name='ckbSetting'][value='1']").prop("checked", true);
			}
		} else {
			if ($(obj).val() === "1") {
				$("input[name='ckbSetting'][value='2'],input[name='ckbSetting'][value='3']").prop("checked", false);
			} else if ($(obj).val() === "2") {
				$("input[name='ckbSetting'][value='3']").prop("checked", false);
			}
		}
		cookieSetting.setting();
	}

	return {
		init: init,
		alertSetting: alertSetting
	}
});


function alertSetting() {
	seajs.use("../static/common/js/layout.js", function(layout) {
		layout.alertSetting();
	});
}